package com.cxyd.modules.log.controller;

import com.cxyd.common.page.PageData;
import com.cxyd.common.utils.Result;
import com.cxyd.modules.log.dto.SysLogApiDTO;
import com.cxyd.modules.log.service.SysLogApiService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("sys/log/api")
public class SysLogApiController {
    private final SysLogApiService sysLogApiService;

    public SysLogApiController(SysLogApiService sysLogApiService) {
        this.sysLogApiService = sysLogApiService;
    }

    @GetMapping("page")
    @RequiresPermissions("sys:log:api")
    public Result<PageData<SysLogApiDTO>> page(@RequestParam Map<String,Object> params){
        PageData<SysLogApiDTO> page = sysLogApiService.page(params);
        return new Result<PageData<SysLogApiDTO>>().ok(page);
    }
}
